<?php
/**
 * 海外仓-一件代发(库存)日志
 * (model)
 */
namespace App\Models\OverSeasBa;


use Encore\Admin\Facades\Admin;
use Illuminate\Database\Eloquent\Model;

class DropshippingLog extends Model{

    protected $table = 'os_b_dropshipping_log';

    protected $guarded = [];

    public static function logs($param = [], $userId = null){
        self::query()->create([
            'batch_no' => $param['batch_no'],
            'box_no' => $param['box_no'],
            'fnsku' => $param['fnsku'],
            'warehouse_id' => $param['warehouse_id'],
            'account_id' => $param['account_id'],
            'psku_id' => $param['psku_id'],
            'box_num_before' => $param['box_num_before'],
            'num_per_box' => $param['num_per_box'],
            'split_box_num' => $param['split_box_num'],
            'ouser_id' => $userId ?: Admin::user()->id]);
    }

}
